<?php
/*
class Clu_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
{

    protected $_auth = null;
    protected $_acl = null;

    public function __construct(Zend_Auth $auth, Zend_Acl $acl)
    {
        $this->_auth = $auth;
        $this->_acl = $acl;

    }
    
    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
    	// This is to combine the Hvn Plugin with Acl plugins
    	// It used to be handled in Clu_Controller_Plugin_Hvn's preDispatch() 
		//
        set_include_path(  
            get_include_path() . PATH_SEPARATOR .  
            APP_PATH.'/modules/'.$request->getModuleName() 
        );
            
    	//Zend_Registry::get('logger')->log('Plugin.Acl.preDispatch', Zend_Log::INFO);

        $module = $request->getModuleName();
        $action = $request->getActionName();
        $controller = $request->getControllerName();
        $requestActionUrl = '/'.$module.'/'.$controller.'/'.$action;
        
		$userPermissions = Zend_Registry::get('userPermissions');
		$sess = new Zend_Session_Namespace(CLU_NS);

		$allRequestPermissions = Zend_Registry::get('permConfiguration')->moduleRequestPermissions;
		$neededPermission = sprintf($allRequestPermissions->{$requestActionUrl}, $module);
		
		if (!$neededPermission ) //OK
		{
    		Zend_Registry::get('logger')->log('Plugin.Acl.preDispatch: No perm defined for request', Zend_Log::INFO);
		}
		else  
		{
			//check if $neededPermission is subset of $userPermissions;
			Zend_Registry::get('logger')->log('Plugin.Acl.preDispatch: neededPermission: '.$neededPermission, Zend_Log::INFO);
			Zend_Registry::get('logger')->log('Plugin.Acl.preDispatch: neededPermission: '.$neededPermission, Zend_Log::INFO);
			Zend_Registry::get('logger')->log('Plugin.Acl.preDispatch: userPermissions: '.$userPermissions, Zend_Log::INFO);
			
			if(!in_array($neededPermission, explode(',', $userPermissions)) &&
				!in_array('administer '.$module, explode(',', $userPermissions)) //not admin either
				)
				 $this->_response->setRedirect('/en/user/error/auth');
		}
		
		//TODO: Some logging here
        //if (!$this->_isAllowed($request))
        //    $this->_response->setRedirect('/en/user/error/auth');
		//TODO: when deletig something. Only 'admin' is able to delete permanently, else only set status
		
    }
    

    
    //TODO: for development only. to be removed
    public function postDispatch(Zend_Controller_Request_Abstract $request)
    {
    	//Zend_Registry::get('logger')->log('Plugin.Acl.postDispatch', Zend_Log::INFO);
    }
    
}
*/
?>